<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>盒子背景</title>
    <style>
      .box {
        background-color: red;
        width: 300px;
        height: 300px;
        /* 设置背景图片 */
        background-image: url("./assets/wallpaper2.jpg");

        /* 设置背景图的平铺方式 */
        background-repeat: no-repeat;

        /* 设置背景图缩放 */
        background-size: contain;
        /* background-size: 100% 100%; */

        /* 设置背景图的位置 */
        /* background-position: 100px 200px; */
        background-position: center center;
      }
    </style>
  </head>
  <body>
    <div class="box">测试盒子背景</div>
  </body>
</html>
